﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class Project
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private int _seq;
        [DataMember]
        public int Seq
        {
            get { return _seq; }
            set { _seq = value; }
        }

        private bool _effective = true;
        [DataMember]
        public bool Effective
        {
            get { return _effective; }
            set { _effective = value; }
        }

        private string _name = string.Empty;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private bool _editable;
        [DataMember]
        public bool Editable
        {
            get { return _editable; }
            set { _editable = value; }
        }

        private int _reportStyle;
        [DataMember]
        public int ReportStyle
        {
            get { return _reportStyle; }
            set { _reportStyle = value; }
        }

        private List<SubProject> _subProjectList = new List<SubProject>();
        [DataMember]
        public List<SubProject> SubProjectList
        {
            get { return _subProjectList; }
            set { _subProjectList = value; }
        }

        public override string ToString()
        {
            return Name;
        }

        public override bool Equals(object obj)
        {
            Project temp = obj as Project;
            if (temp == null)
                return false;
            return (this.ID.Equals(temp.ID));
        }
    }
}
